<template>
    <div class="container">
		<h3>审核还款</h3>
        <el-form :model="ruleForm" ref="ruleForm" :rules="rules"  label-width="180px" class="demo-ruleForm">
           <el-table
               :data="tableData"
               border
               style="margin-top:20px;"
               ref="multipleTable"
               header-cell-class-name="table-header"
           >
			<el-table-column prop="name" sortable label="申请人"></el-table-column>
			<el-table-column prop="createTime" sortable label="申请时间"></el-table-column>
			<el-table-column prop="amount" sortable label="申请金额"></el-table-column>
			<el-table-column prop="loanPeriod" sortable label="还款周期"></el-table-column>
			<el-table-column prop="surplusNum" sortable label="剩余周期"></el-table-column>
			<el-table-column prop="repaidAmount" sortable label="已还金额"></el-table-column>
			<el-table-column prop="surplusAmount" sortable label="剩余还款"></el-table-column>
			<el-table-column prop="repaymentTime" sortable label="还款时间"></el-table-column>
			<el-table-column prop="realAmount" sortable label="本期还款">

			</el-table-column>
			<el-table-column label="操作" width="150" align="center">
				<template slot-scope="scope">
			      <el-button
			          type="text"

			          @click="repaymentaudit(scope.$index, scope.row)"
			      >审核</el-button>

			    </template>
			</el-table-column>
           </el-table>
           <el-pagination
               layout="total, prev, pager, next, jumper"
               :page-size="pagesize1"
               :current-page.sync="page"
               :total="total1"
               @current-change="handleCurrentChange1"
               style="margin-top: 20px"
           ></el-pagination>
            <el-form-item class="footerFixed" label-width="0px">
                <el-button @click="backPage">返回</el-button>
            </el-form-item>

        </el-form>
    </div>
</template>

<script>
import axios from "axios"
import uploadImg from '../../../common/uploadImg';
export default {
	components: {
	    uploadImg
	},
    data() {
        return {
			ruleForm:{},
			pagesize1:10,
			page:1,
			total1:0,

			tableData:[],
			amount:{},
			backname:{},
			bankShow:false,
			bankList:[],
			subBank:[],
            rules: {},
			id:''
        };
    },
    mounted() {

        this.init();

    },
    methods: {
		handleCurrentChange1(val){

			this.page = val;
			this.init();
		},

		// 返回上一页
        backPage() {
            this.$router.go(-1);
        },
		// 获取详情
        init(){
			let data2 = {
				page:this.page
			}
			axios.post("http://grove.cpzsyun.com:81/api/control/loanInfo/findListRepay",data2).then((res)=>{
			// axios.post("http://grove.cpzsyun.com:81/api/control/loanInfo/findListRepay",data).then((res)=>{
				this.tableData= res.data.rows

				for(let i = 0 ; i<this.tableData.length;i++){
					this.tableData[i].createTime = this.tableData[i].createTime.substring(0,10)
				}
			})
		},

		repaymentaudit(index,row){
			this.$router.push({
			    path: '/finance/audit',
			    query: {
			        id: row.id
			    }
			});
		},
    }
};
</script>

<style scoped>
	.el-pagination {
	    text-align: center;
	}
</style>
